<template>
  <div>
    <div class="indexPage" style="margin-bottom: 40px;">
      <div class="" style="font-size: 32px;color: black;margin-bottom: 20px;">转跳路由按钮:</div>
      <div class="flex" style="flex-wrap: wrap;">
        <div v-for="item in routesData" style="padding: 20px;">
          <router-link :to="{ name: `${item.name}` }"><el-button type="primary" style="margin-right: 10px;"
           >{{ item.title }}</el-button></router-link>
        </div>
      </div>
    </div>
    <iframe id="indexPage" width="460" height="330" src="http://124.223.116.161:9003/#/TimeSelect">
    </iframe>
    <el-button type="primary" style="margin-left: 10px;" @click="clickDataTrue()">获取数据</el-button>
    <el-button type="primary" style="margin-left: 10px;" @click="clickDataTrue()">获取数据</el-button>

  </div>
</template>

<script>
import routes from "../router/index"
export default {
  data() {
    return {
      routesData: []
    }
  },
  created() {
    this.routesData = routes.options.routes
    console.log("数据", this.routesData);

  },

  methods: {
    clickDataTrue() {
      window.addEventListener('message', function (e) {
        let message_data = e.data.data
        console.log("~~~~~~~~~:", message_data)
      }, false)
      // window.postMessage({ TimeData: this.value1 }, "*")
      // window.addEventListener("storage", function (e) {
      //   console.log(e)
      //   console.log(e.newValue)
      // })

    },
  }
}
</script>

<style lang="scss" scoped>
.indexPage {
  // display: flex;
  margin: 0;
  padding: 0;
}
</style>